{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/fibonacci-number\n",
    "\n",
    "\n",
    "Runtime: 32 ms, faster than 63.85% of Python3 online submissions for Fibonacci Number.\n",
    "Memory Usage: 14.2 MB, less than 72.42% of Python3 online submissions for Fibonacci Number.\n",
    "\n",
    "\n",
    "```python\n",
    "class Solution:\n",
    "    def fib(self, n: int) -> int:\n",
    "        #:4:23\n",
    "        if n == 0:\n",
    "            return 0\n",
    "        arr = [0, 1]\n",
    "        i = 2\n",
    "        while i < n:\n",
    "            newValue = sum(arr[-2:])\n",
    "            #arr = arr[-1:] + [newValue]\n",
    "            arr.append(newValue)\n",
    "            i += 1\n",
    "            #print(arr, r)\n",
    "        return sum(arr[-2:])\n",
    "        #4:37\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
